﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Permission.ascx.cs" Inherits="HeThong_AccountGroup_Permission" %>
<div class="subnav admin-views-subnav">
    <div class="container-fluid">
        <ul class="nav nav-pills">
            <li><a href="Default.aspx">AccountGroup</a></li>
            <li class="active"><a href="#">Phân quyền</a></li>

        </ul>
    </div>
</div>
<div class="container-fluid">
    <div class="form-horizontal form-bordered form-validate" id="create">
        <div class="page-header clearfix">
            <h2 class="page-title pull-left">Phân quyền <%=AccountGroup.Name %>
                <span id="spinner" class="loaded"><i class="fa fa-spinner fa-spin fa-sm"></i></span>
            </h2>
            <button class="btn btn-success btn-header pull-right" type="submit" runat="server" id="btnSave2" onserverclick="btnSave_ServerClick"><i class="fa fa-save"></i>Lưu</button>
        </div>

        <div class="editor admin-editor">

            <div id="overlay-editor">

                <div class="row clearfix">
                    <div class="col-md-9">
                        <div class="well">
                            <div class="form-horizontal clearfix">

                                <asp:TreeView ID="TreeMenu" runat="server" ImageSet="Simple" ShowLines="True" EnableViewState="True" ExpandDepth="0" ShowCheckBoxes="All">
                                    <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" />
                                    <ParentNodeStyle ForeColor="red" Font-Bold="true" />
                                    <RootNodeStyle Font-Bold="true" ForeColor="red" />
                                    <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" />
                                    <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
                                </asp:TreeView>


                            </div>

                        </div>
                    </div>

                    <div class="col-md-3">
                    </div>
                </div>

                <hr>
                <div class="btn-wrapper clearfix">
                    <div class="pull-left">
                        <button disabled="disabled" class="btn btn-default" style="border: none;">
                            <i class="fa fa-info-circle"></i>

                            <span class="ng-scope "></span>
                        </button>
                    </div>
                    <div class="pull-right">
                        <span id="spinner" class="loaded"><i class="fa fa-spinner fa-spin fa-lg"></i></span>
                        <a href="Default.aspx" class="btn btn-default "><i class="fa fa-ban"></i>Hủy</a>


                        <button type="submit" class="btn btn-success " id="btnSave" runat="server" onserverclick="btnSave_ServerClick"><i class="fa fa-save"></i>Lưu</button>



                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<script type="text/javascript">
    $(function () {
        $("[id*=TreeMenu] input[type=checkbox]").bind("click", function () {
            var table = $(this).closest("table");
            if (table.next().length > 0 && table.next()[0].tagName == "DIV") {
                //Is Parent CheckBox
                var childDiv = table.next();
                var isChecked = $(this).is(":checked");
                $("input[type=checkbox]", childDiv).each(function () {
                    if (isChecked) {
                        $(this).attr("checked", "checked");
                    } else {
                        $(this).removeAttr("checked");
                    }
                });
            } else {
                //Is Child CheckBox
                var parentDIV = $(this).closest("DIV");
                if ($("input[type=checkbox]", parentDIV).length == $("input[type=checkbox]:checked", parentDIV).length) {
                    $("input[type=checkbox]", parentDIV.prev()).attr("checked", "checked");
                } else {
                    $("input[type=checkbox]", parentDIV.prev()).removeAttr("checked");
                }
            }
        });
    })

</script>
